arr = []

// 用于识别网站是否有效
for (let index = 9999; index < 10999; index++) {
    let url = `https://www.${index}.com/`
    fetch(url, {}).then(async response => {
        // console.log(response);
        if (response.status >= 200 && response.status < 300) { // 判断请求是否成功
            let tt = await response.text()
            // console.log('', tt)
            if (tt.includes('彩票')) { }
            else if (tt.includes('澳门')) { }
            else if (tt.includes('游戏')) { }
            else if (tt.includes('OPGG.COM')) { }
            else if (tt.includes('娱乐')) { }
            else if (tt.includes('电动志趣享')) { }
            else if (tt.includes('电动')) { }
            else if (tt.includes('网游')) { }
            else if (tt.includes('新闻')) { }
            else if (tt.includes('棋牌')) { }
            else if (tt.includes('斗地主')) { }
            else if (tt.includes('志趣享')) { }
            else if (tt.includes('手游')) { }
            else if (tt.includes('体育')) { }
            else if (tt.includes('试玩')) { }
            else if (tt.includes('直播')) { }
            else if (tt.includes('快播')) { }
            else if (tt.includes('赛事')) { }
            else if (tt.includes('热血')) { }
            else if (tt.includes('休闲')) { }
            else if (tt.includes('塔防')) { }
            else if (tt.includes('策略')) { }
            else arr.push(response.url)
            return tt // 得到文本字符串。
        } else {
            throw new Error(response.statusText);
        }
    }).then(json => {
        // console.log(json);  // 得到最终结果。
    }).catch(err => {
        console.log('Request Failed', err)
    });
}


// 用于打开有效网站
for (let index = 0; index < 50; index++) {
    const element = arr[index];
    window.open(element, index)
}
for (let index = 0; index < 50; index++) {
    arr.shift()
}
